- return unless @project.feature_available?(:push_rules)

- expanded = expanded_by_default?
%section.settings.no-animate#js-push-rules{ class: ('expanded' if expanded), data: { qa_selector: 'push_rules_content' } }
  .settings-header
    %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
      = s_('PushRule|Push rules')
    = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
      = expanded ? _('Collapse') : _('Expand')
    %p
      = s_('PushRules|Restrict push operations for this project.')
      = link_to _('Learn more.'), help_page_path('user/project/repository/push_rules'), target: '_blank', rel: 'noopener noreferrer'
  .settings-content
    %h5
      = s_('PushRules|Select push rules')
    = gitlab_ui_form_for [@project, @push_rule] do |f|
      = form_errors(@push_rule)

      = render "shared/push_rules/form", f: f, context: @project
